package com.oc.mba.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * OcPaper entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "oc_paper", catalog = "openmba")
public class OcPaper implements java.io.Serializable {

	// Fields

	private Integer id;
	private String paperTitle;
	private String paperDesc;
	private String paperSerial;
	private Integer paperType;
	private String paperTypeTitle;
	private Double paperPrice;
	private Integer paperVersion;
	private Integer paperStatus;
	private Set<OcPaperQuestion> ocPaperQuestions = new HashSet<OcPaperQuestion>(
			0);

	// Constructors

	/** default constructor */
	public OcPaper() {
	}

	/** minimal constructor */
	public OcPaper(String paperTitle, Double paperPrice) {
		this.paperTitle = paperTitle;
		this.paperPrice = paperPrice;
	}

	/** full constructor */
	public OcPaper(String paperTitle, String paperDesc, String paperSerial,
			Integer paperType, String paperTypeTitle, Double paperPrice,
			Integer paperVersion, Integer paperStatus,
			Set<OcPaperQuestion> ocPaperQuestions) {
		this.paperTitle = paperTitle;
		this.paperDesc = paperDesc;
		this.paperSerial = paperSerial;
		this.paperType = paperType;
		this.paperTypeTitle = paperTypeTitle;
		this.paperPrice = paperPrice;
		this.paperVersion = paperVersion;
		this.paperStatus = paperStatus;
		this.ocPaperQuestions = ocPaperQuestions;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "paper_title", nullable = false)
	public String getPaperTitle() {
		return this.paperTitle;
	}

	public void setPaperTitle(String paperTitle) {
		this.paperTitle = paperTitle;
	}

	@Column(name = "paper_desc")
	public String getPaperDesc() {
		return this.paperDesc;
	}

	public void setPaperDesc(String paperDesc) {
		this.paperDesc = paperDesc;
	}

	@Column(name = "paper_serial")
	public String getPaperSerial() {
		return this.paperSerial;
	}

	public void setPaperSerial(String paperSerial) {
		this.paperSerial = paperSerial;
	}

	@Column(name = "paper_type")
	public Integer getPaperType() {
		return this.paperType;
	}

	public void setPaperType(Integer paperType) {
		this.paperType = paperType;
	}

	@Column(name = "paper_type_title")
	public String getPaperTypeTitle() {
		return this.paperTypeTitle;
	}

	public void setPaperTypeTitle(String paperTypeTitle) {
		this.paperTypeTitle = paperTypeTitle;
	}

	@Column(name = "paper_price", nullable = false, precision = 22, scale = 0)
	public Double getPaperPrice() {
		return this.paperPrice;
	}

	public void setPaperPrice(Double paperPrice) {
		this.paperPrice = paperPrice;
	}

	@Column(name = "paper_version")
	public Integer getPaperVersion() {
		return this.paperVersion;
	}

	public void setPaperVersion(Integer paperVersion) {
		this.paperVersion = paperVersion;
	}

	@Column(name = "paper_status")
	public Integer getPaperStatus() {
		return this.paperStatus;
	}

	public void setPaperStatus(Integer paperStatus) {
		this.paperStatus = paperStatus;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "ocPaper")
	public Set<OcPaperQuestion> getOcPaperQuestions() {
		return this.ocPaperQuestions;
	}

	public void setOcPaperQuestions(Set<OcPaperQuestion> ocPaperQuestions) {
		this.ocPaperQuestions = ocPaperQuestions;
	}

}